﻿using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

namespace SoapStudio.ViewModels;

public class ViewModelLocator
{
    public ViewModelLocator()
    {
        Ioc.Default.ConfigureServices(
            new ServiceCollection()
                .AddSingleton<MainViewModel>()
                .AddSingleton<CalculatorViewModel>()
                .BuildServiceProvider()
        );
    }

    public CalculatorViewModel CalculatorViewModel => Ioc.Default.GetService<CalculatorViewModel>();
    public MainViewModel MainViewModel => Ioc.Default.GetService<MainViewModel>();
}
